import dayjs from 'dayjs'

import Vue from 'vue'

import 'dayjs/locale/zh-cn'

var relativeTime = require('dayjs/plugin/relativeTime')
dayjs.extend(relativeTime)

dayjs.locale('zh-cn')
// console.log(dayjs().format('YYYY-MM-DD HH:mm:ss'))

// console.log(dayjs().to('2021-08-06 12:00:00'))
// console.log(dayjs().from('2021-08-06 12:00:00'))
Vue.filter('relativeTime', val => {
  return dayjs().to(val)
})
